<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" language="java" %>
<%@ page import="com.appspot.bibtable.UrlCollection" %>
<%@ page import="com.appspot.bibtable.model.*" %>
<%@ page import="com.appspot.bibtable.view.html.*" %>
<%@ page import="com.google.appengine.api.users.*" %>
<%
HtmlTemplate template = new HtmlTemplate();
template.setTitle("Help");
template.setRequest(request);
template.startDocument(out);
template.startContent(out);

UserService service = UserServiceFactory.getUserService();
boolean isLoggedIn = service.isUserLoggedIn();
boolean isRegistered = isLoggedIn && UserInfo.getUserInfoOf(service.getCurrentUser()) != null;
%>
<ul id="contents">
	<li><a href="#about">What is BibTable?</a></li>
	<li><a href="#cost">How much does it cost?</a></li>
	<li><a href="#sing-in">Do I need to sign in to use BibTable?</a></li>
	<li><a href="#restriction">Is there any restriction in using BibTable?</a></li>
	<li><a href="#unregistration">I want to cancel my membership. What should I do?</a></li>
</ul>
<h3 id="about">What is BibTable?</h3>
<p>
	BibTable is a social bookmark service specialized in academic bibliography.
</p>
<h3 id="cost">How much does it cost?</h3>
<p>
	Free.
</p>
<h3 id="how-to">Tell me how to use search box.</h3>
<p>
	See <a href="<%= UrlCollection.TIPS %>">Tips</a>.
</p>
<h3 id="sing-in">Do I need to sign in to use BibTable?</h3>
<p>
	You can get any records without signing in.
	In order to add, edit, or bookmark them,
	you must <%= isLoggedIn ? "sign in" : ("<a href=\"" + service.createLoginURL(UrlCollection.INDEX) + "\">sign in</a>") %>
	with your <a href="https://www.google.com/accounts/">Google Account</a>
	and <%= isRegistered ? "register the service" : ("<a href=\"" + UrlCollection.REGISTRATION + "\">register the service</a>") %>. 
</p>
<h3 id="restriction">Is there any restriction in using BibTable?</h3>
<p>
	Since BibTable works on <a href="http://code.google.com/intl/en/appengine/">Google App Engine</a> with no billing,
	there are <a href="http://code.google.com/intl/en/appengine/docs/quotas.html#Resources">some limits to resources</a>.
	The quotas are, probably, sufficient for this application;
	however, keep it in mind that overloading will make the service stop.
</p>
<h3 id="unregistration">I want to cancel my membership. What should I do?</h3>
<p>
	Visit <%= isRegistered ? ("<a href=\"" + UrlCollection.PROFILE + "\">your profile page</a>") : "your profile page" %>
	and try to unregister.
	If your request is accepted, notice that you are not registered will be shown beside your account name.
	Be careful that you dispose all your account information on BibTable after cancellation your membership.
</p>
<%
template.endContent(out);
template.endDocument(out);
%>
